package cn.edu.scau.cmi.wangzm.singleton;

import java.util.ArrayList;

public class MarshalPool {
	private static ArrayList<Marshal> arrayList = new ArrayList<>();
	private static int num = 0;
	static {
	arrayList.add(new Marshal(""));
   	arrayList.add(new Marshal(""));
   	arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    arrayList.add(new Marshal(""));
    
    }
	
	public static Marshal getMarsahal() {
		if(num>=10) {
			return null;
		}
		Marshal marsahal = arrayList.get(num);
		num++;
		return marsahal;
	}
}
